Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip intermediate PtrAdds. #1468

Closed
wants to merge 1 commit into from
Closed

Conversation

ltratt
Copy link
Contributor

@ltratt ltratt commented Nov 18, 2024

A common pattern we see is:

%7: ptr = ptr_add %0, 2
%8: ptr = ptr_add %7, 3

This can be annoying because %7 sometimes isn't really used other than as a vehicle for %8. This commit rewrites %8 to:

%8: ptr = ptr_add %0, 5

This can reduce the pressure on the register allocator a little bit. Has a small (0.5%), but measurable effect on big_loop.

A common pattern we see is:

```
%7: ptr = ptr_add %0, 2
%8: ptr = ptr_add %7, 3
```

This can be annoying because `%7` sometimes isn't really used other than as a
vehicle for `%8`. This commit rewrites `%8` to:

```
%8: ptr = ptr_add %0, 5
```

This can reduce the pressure on the register allocator a little bit. Has
a small (0.5%), but measurable effect on big_loop.
@vext01 vext01 added this pull request to the merge queue Nov 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 18, 2024
@ltratt
Copy link
Contributor Author

ltratt commented Nov 18, 2024

I think this one has failed for spurious reasons, but I may have had a cunning plan to extend it, so let's not merge it quite yet.

@ltratt
Copy link
Contributor Author

ltratt commented Nov 22, 2024

Closing in favour of an upcoming PR.

@vext01
Copy link
Contributor

vext01 commented Nov 29, 2024

Did you mean to close this?

@ltratt
Copy link
Contributor Author

ltratt commented Nov 29, 2024

Oops, yes!

@ltratt ltratt closed this Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants